Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 add accept-language header to goingtocamp requests #340

Merged
merged 1 commit into from
Apr 26, 2024

Conversation

regaw-leinad
Copy link
Contributor

@regaw-leinad regaw-leinad commented Apr 26, 2024

Description

This PR addresses the issue reported in #328, where API requests from camply to the GoingToCamp WA site were being blocked by DataDome, resulting in a 403 captcha error.

Upon examining the network requests on the GoingToCamp WA site, I observed that their API calls included a large set of HTTP headers, including those related to DataDome's bot protection. To isolate the essential headers required to prevent the API request from being rejected, I just copied the request and removed headers one by one. I identified that retaining only the User-Agent and Accept-Language headers circumvented the issue.

Further investigation into the DataDome Request Validation API revealed that the Accept-Language header is among the top headers validated by DataDome. Including this header makes our API requests appear more legitimate (which it is), aligning closely with typical user requests, thus avoiding immediate rejection.

It's important to clarify that this modification does not represent a bypass of the captcha mechanism but rather an enhancement to the request headers to align with validation checks. This approach is currently effective, but it is susceptible to changes should GoingToCamp WA update their bot protection strategies.

I'm aware of your comment about captchas #287 (comment), so please close this if this is not something you're into. Not intending to break captcha with this, just replicating the network request on their website more accurately with a single header addition.

Has This Been Tested?

Before

Screenshot 2024-04-26 at 2 13 24 PM

After

Screenshot 2024-04-26 at 2 13 48 PM

Checklist:

  • I've read the contributing guidelines of this project
  • I've installed and used .pre_commit on all my code
  • I have documented my code, particularly in hard-to-understand areas
  • I have made any necessary corresponding changes to the documentation

@juftin
Copy link
Owner

juftin commented Apr 26, 2024

Whoa, I'm blown away by the detail included here. Thank you very much @regaw-leinad. I'd be happy to have this contribution!!

@juftin juftin self-assigned this Apr 26, 2024
@juftin juftin self-requested a review April 26, 2024 22:01
@juftin juftin added the bug Something isn't working label Apr 26, 2024
@juftin
Copy link
Owner

juftin commented Apr 26, 2024

Tested working.

Closes #328

@juftin juftin merged commit d400366 into juftin:main Apr 26, 2024
7 checks passed
@juftin juftin mentioned this pull request Apr 26, 2024
@juftin
Copy link
Owner

juftin commented Apr 26, 2024

🎉 This PR is included in version 0.32.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@juftin
Copy link
Owner

juftin commented Apr 26, 2024

Can't believe this was this easy - what a find. This is released on PyPI on 0.32.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants